import java.util.Vector;

/**
 * This class is a container for the results obtained during the rating process.
 * It stores the good, bad and neutral sentences, the best products and
 * the best comments.
 *
 */
public class RatingResult {
	
	private Vector<String> goodSentences = new Vector<String>();
	private Vector<String> neutralSentences = new Vector<String>();
	private Vector<String> badSentences = new Vector<String>();
	private Vector<String> bestComment = new Vector<String>();
	private Vector<String> bestProducts = new Vector<String>();
	private double averageScore;
	
	
	
	// GOOD SENTENCES ##########################
	public void addGoodSentence(String s){
		goodSentences.add(s);
	}
	
	public Vector<String> getGoodSentences() {
		return goodSentences;
	}

	public void setGoodSentences(Vector<String> goodSentences) {
		this.goodSentences = goodSentences;
	}
	
	public void displayGoodSentences(int number) {
		if(number <1)
		{
			System.out.println("Error, the number must be positive");
		}
		else if(number==0 || number>goodSentences.size())
		{
			for(String s:goodSentences)
				System.out.println("POS: "+s+"]");
		}
		else
		{
			for(int i=0; i<number;i++)
			{
				System.out.println("POS: ["+goodSentences.get(i)+"]");
			}
		}
	}
	//END GOOD SENTENCES
	
	
	
	// BAD SENTENCES ###########################
	public void addBadSentence(String s){
		badSentences.add(s);
	}
	
	public Vector<String> getBadSentences() {
		return badSentences;
	}

	public void setBadSentences(Vector<String> badSentences) {
		this.badSentences = badSentences;
	}
	
	public void displayBadSentences(int number) {
		if(number <1)
		{
			System.out.println("Error, the number must be positive");
		}
		else if(number==0 || number>badSentences.size())
		{
			for(String s:badSentences)
				System.out.println("NEG: "+s+"]");
		}
		else
		{
			for(int i=0; i<number;i++)
			{
				System.out.println("NEG: ["+badSentences.get(i)+"]");
			}
		}
	}
	//END BAD SENTENCES
	
	
	
	
	// NEUTRAL SENTENCES #######################
	public void addNeutralSentence(String s){
		neutralSentences.add(s);
	}
	
	public Vector<String> getNeutralSentences() {
		return neutralSentences;
	}

	public void setNeutralSentences(Vector<String> neutralSentences) {
		this.neutralSentences = neutralSentences;
	}
	
	public void displayNeutralSentences(int number) {
		if(number <0)
		{
			System.out.println("Error, the number must be positive");
		}
		else if(number==0 || number>neutralSentences.size())
		{
			for(String s:neutralSentences)
				System.out.println("NEU: "+s+"]");
		}
		else
		{
			for(int i=0; i<number;i++)
			{
				System.out.println("NEUTRAL: ["+neutralSentences.get(i)+"]");
			}
		}
	}
	// END NEUTRAL SENTENCES
	
	
	
	
	// BEST COMMENT #########################
	public void setBestComment(Vector<String> bestComment) {
		this.bestComment = bestComment;
	}
	
	public Vector<String> getBestCommen() {
		return bestComment;
	}
	
	public void displayBestComment(int number) {
		if(number <0)
		{
			System.out.println("Error, the number must be positive");
		}
		else if(number==0 || number>bestComment.size())
		{
			int i=1;
			for(String s:bestComment)
			{
				System.out.println("Comment ranked "+i+": "+s);
				i++;
			}
		}
		else
		{
			for(int i=0; i<number;i++)
			{
				System.out.println("Comment ranked "+(i+1)+": "+bestComment.get(i));
			}
		}
	}
	//END BEST COMMENT

	
	

	// BEST PRODUCT #########################
	public Vector<String> getBestProducts() {
		return bestProducts;
	}

	public void setBestProducts(Vector<String> bestProducts) {
		this.bestProducts = bestProducts;
	}
	
	public void displayBestProducts(int number) {
		if(number <0)
		{
			System.out.println("Error, the number must be positive");
		}
		else if(number==0 || number>bestProducts.size())
		{
			int i=1;
			for(String s:bestProducts)
			{
				System.out.println("Product ranked "+i+": "+s);
				i++;
			}
		}
		else
		{
			for(int i=0; i<number;i++)
			{
				System.out.println("Product ranked "+(i+1)+": "+bestProducts.get(i));
			}
		}
	}
	// END BEST PRODUCT

	
	

	// AVERAGE SCORE ########################
	public double getAverageScore() {
		return averageScore;
	}

	public void setAverageScore(double averageScore) {
		this.averageScore = averageScore;
	}
	//END AVERAGE SCORE


}
